package Company

import (
	"ali-hr/Database"
	"ali-hr/Models"
	"github.com/gookit/goutil/dump"
)

/**
 * Created by Goland
 * User: wkk alisleepy@hotmail.com
 * Time: 2022/4/5 - 16:10
 * Desc: <法人主体相关service>
 */

// GetAllCompanies 获取所有已生效的法人主体
func GetAllCompanies() []Models.Company {
	var companies []Models.Company
	// err := Database.SqlDB.Where("status = ?", Models.STATUS_USED).Find(&companies).Error
	err := Database.SqlDB.Find(&companies).Error
	if err != nil {
		dump.P("获取全部已生效的法人主体失败，err:", err)
		return nil
	}
	return companies
}
